package org.osami.gateway.watteco;

public class Timer extends Thread
{
	private volatile boolean expired;
	private long delay;
	
	public Timer(long delay)
	{
		this.expired = false;
		this.delay = delay;
		this.setDaemon(true);
	}
	
	public void run()
	{
		try
		{
			Thread.sleep(this.delay);
		}
		catch (InterruptedException e)
		{
		}
		
		synchronized (this)
		{
			this.expired = true;
		}
	}
	
	public synchronized boolean hasExpired()
	{
		return this.expired;
	}
}

